import http from "./http";

//上传文件
export const URL_UP_LOAD_FILE = "/v1/file/photos";
//获取上传图片url
export const URL_GET_IMG_URL = "/v1/migutask/photos";
//创建任务
export const URL_GET_IMG_VIDEO = "/v1/migutask";
//查询任务进度
export const URL_GET_Upload_Process = "/v1/migutask/query";
//上传文件
export const apiUploadFile = (
    data: any
): Promise<Array<{ fileId: string; fileName: string }>> =>
    http.post(URL_UP_LOAD_FILE, data);
//获取上传图片url
export const apiGetImgUrl = (id: string): Promise<any> => {
    let url: string = `${URL_GET_IMG_URL}?id=${id}`;
    return http.get(url);
}
//创建任务
export const apiGetImgVideo = (
    data: any
): Promise<any> => {
    return http.post(URL_GET_IMG_VIDEO, data);
}
//查询任务进度
export const apiGetProcess = (
    taskId: string
): Promise<any> => {
    let url: string = `${URL_GET_Upload_Process}?taskId=${taskId}`;
    return http.get(url);
}